package com.stool.cloud.api;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @author Felix YF Dong
 * @Description
 * @Date 2023/2/9
 */
@RestController
@RequestMapping("/provider")
public class ProviderApi {

    @Value("${server.port}")
    private String serverPort;
;
    public static HashMap<String, String> resultMap = new HashMap<>();
    static {
        resultMap.put("1", "eweqwsad111111111111111");
        resultMap.put("2", "ewqeqweqweqwew222222222");
        resultMap.put("3", "fsdfsdfdsfdsf3333333333");
        resultMap.put("4", "ewrewrwevw4444444444443");
    }

    @GetMapping("/{id}")
    public String providerQL(@PathVariable("id") String id) {

        String result = resultMap.get(id) + "****** from " + serverPort;
        return result;
    }
}
